import React from 'react'
import { Button, Tag } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import request from '@/utils/request'
export default () => {

    const columns: any = [
        {
            title: '服务名称',
            dataIndex: 'type_title',
            valueEnum: {
                1: { text: '7天退换' },
                2: { text: '正品保障' },
                3: { text: '2h 发货' },
                4: { text: '退货承诺' },
                5: { text: '试用中心' },
                6: { text: '实体验证' },
                7: { text: '消协保证' },
            },
        },
        {
            title: '店铺名称',
            render: (text: any) => <Tag color="cyan">{text} </Tag>,
            align: "center",
            dataIndex: 'store_title',
            hideInSearch: true,
        },
        {
            title: '申请时间',
            render: (text: any) => <Tag color="green">{text} </Tag>,
            dataIndex: 'apply_at',
            align: "center",
            valueType: "dateRange",
        },
        {
            title: '通过时间',
            render: (text: any) => <Tag color="green">{text} </Tag>,
            dataIndex: 'pass_at',
            align: "center",
            hideInSearch: true,
        },
        {
            title: '审核状态',
            render: (text: any) => <Tag color="green">{text} </Tag>,
            dataIndex: 'audit_status',
            align: "center",
            valueEnum: {
                1: { text: '待审核' },
                2: { text: '已通过' },
                3: { text: '已拒绝' },
            }
        },
        {
            title: '操作',
            align: "center",
            render: (text: any, record: any) => (
                <>
                    <Button size="small" type="primary" ghost style={{ marginRight: "6px" }}>编辑</Button>
                    <Button size="small" danger>删除</Button>
                </>
            ),
        },
    ];

    return (
        <PageHeaderWrapper title={false}>
            <ProTable<any>
                toolBarRender={false}
                headerTitle={null}
                rowKey="id"
                columns={columns}
                request={(params: any) => request('/store/service-list', {
                    params,
                })}
                tableAlertRender={false}
            />
        </PageHeaderWrapper>
    )
}